
# 使用第三方库requests发送请求
import requests

name = input("你想搜索的关键字：")
# url = f'https://www.sogou.com/web?query={name}'
url = "https://www.sogou.com/web?query="+ name
print(url)

dic = {
    "User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36"
}
resp = requests.get(url,headers=dic)
print(resp)
print(resp.text)